<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>小门官系统首页</title>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link th:href="@{favicon.ico}" rel="shortcut icon"/>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/jquery.contextMenu.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/font-awe	some.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/skins.css}" rel="stylesheet"/>
    <link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.8}" rel="stylesheet"/>
    <!-- 公共样式表 需要再include的表中同时添加才生效	-->
    <link th:href="@{/css/public.css}" rel="stylesheet"/>
    <style>
    </style>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" th:classappend="${isMobile} ? 'canvas-menu'"
      style="overflow: hidden">
<div id="wrapper">

    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation" style="background: #BBDBF3">
        <div class="nav-close">
            <i class="fa fa-times-circle">123123132</i>
        </div>
        <div id="logo"
             style="background-color: #BBDBF3;width: 200px;height:65px;display: flex;justify-content: flex-start;align-items: center;line-height: 50px;padding: 20px 10px;box-sizing: border-box">
            <a th:href="@{/index}" style="height: 25px;">
                <img th:src="@{/img/logo.png}" width="36px"
                     height="36px" style="border-radius: 5px">
                <span class="logo-title">小门官管理后台</span>
            </a>
        </div>
        <div class="sidebar-collapse" id="sidebar-collapse" style="background-color: #BBDBF3">
            <!--概况样式-->
            <ul class="nav" id="side-menu">
                <li class="xiaoma" style="margin-top: 20px;background-color: #BBDBF3;" id="selectGk">
                    <a class="menuItem" th:href="@{/system/main}" id="systemMain">
                        <i class="fa fa-home" style="color: #333"></i>
                        <span class="nav-label" style="color: #333">概况</span> </a>
                </li>
                <li th:each="menu : ${menus}" class="xiaoma" id="selectChild">
                    <a th:class="@{${!#strings.isEmpty(menu.url) && menu.url != '#'} ? ${menu.target}}"
                       th:href="@{${#strings.isEmpty(menu.url)} ? |#| : ${menu.url}}"
                       th:data-refresh="${menu.isRefresh == '0'}">
                        <i class="fa fa-bar-chart-o" th:class="${menu.icon}"></i>
                        <!--						名字-->
                        <span class="nav-label" th:text="${menu.menuName}">7897897979</span>
                        <span th:class="${#strings.isEmpty(menu.url) || menu.url == '#'} ? |fa arrow|"></span>
                    </a>
                    <ul class="nav nav-second-level collapse">
                        <li th:each="cmenu : ${menu.children}">
                            <a th:if="${#lists.isEmpty(cmenu.children)}"
                               th:class="${#strings.isEmpty(cmenu.target)} ? |menuItem| : ${cmenu.target}"
                               th:utext="${cmenu.menuName}" th:href="@{${cmenu.url}}"
                               th:data-refresh="${cmenu.isRefresh == '0'}" id="secodeChild">二级菜单</a>
                            <a th:if="${not #lists.isEmpty(cmenu.children)}"
                               href="javascript:;">[[${cmenu.menuName}]]<span class="fa arrow"></span></a>
                            <ul th:if="${not #lists.isEmpty(cmenu.children)}" class="nav nav-third-level">
                                <li th:each="emenu : ${cmenu.children}">
                                    <a th:if="${#lists.isEmpty(emenu.children)}"
                                       th:class="${#strings.isEmpty(emenu.target)} ? |menuItem| : ${emenu.target}"
                                       th:text="${emenu.menuName}" th:href="@{${emenu.url}}"
                                       th:data-refresh="${emenu.isRefresh == '0'}">三级菜单</a>
                                    <a th:if="${not #lists.isEmpty(emenu.children)}" href="javascript:;">[[${emenu.menuName}]]<span
                                            class="fa arrow"></span></a>
                                    <ul th:if="${not #lists.isEmpty(emenu.children)}" class="nav nav-four-level">
                                        <li th:each="fmenu : ${emenu.children}"><a
                                                th:if="${#lists.isEmpty(fmenu.children)}"
                                                th:class="${#strings.isEmpty(fmenu.target)} ? |menuItem| : ${fmenu.target}"
                                                th:text="${fmenu.menuName}" th:href="@{${fmenu.url}}"
                                                th:data-refresh="${fmenu.isRefresh == '0'}">四级菜单</a></li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->

    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom" style="display: block;">
            <nav class="navbar navbar-static-top" role="navigation" id="nav1"
                 style="margin-bottom: 0;background-color: transparent;width: 100%">
                <div style="display:flex;justify-content: flex-end;align-items: center;width: 90%">
                    <!-- 右侧头像部分 -->
                    <div class="nav navbar-top-links navbar-right2">
                        <ul style="display: flex;align-items: center;justify-content: flex-end">
                            <li class="user-menu">
                                <a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
                                    <img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}"
                                         th:onerror="this.src='img/profile.jpg'" class="user-image"
                                         style="width: 46px;height: 46px;border-radius: 50%">
                                    <span class="hidden-xs"
                                          style="color: black;font-size: 20px !important; color: #333333;">[[${#strings.defaultString(user.userName, '-')}]]</span>
                                </a>
                            </li>
                            <li>
                                <a onclick="resetPwd()" class="tuichu"
                                   style="padding:8px 0;color: #333333">【修改密码】</a>
                            </li>
                            <li>
                                <a th:href="@{logout}" class="tuichu" style="padding:8px 0;color: #333333">【退出】</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
            <nav class="navbar navbar-static-top" role="navigation" id="nav2"
                 style="margin-bottom: 0;background-color: transparent;width: 100%">
                <div style="display:flex;justify-content: space-around;align-items: center;width: 100%">
                    <!-- 年月日时分秒 -->
                    <div id="date">2025年03月10日 14:40:40</div>
                    <div class="nav-bg"></div>
                    <!-- 右侧头像部分 -->
                    <div class="nav navbar-top-links navbar-right1">
                        <ul style="display: flex;align-items: center;justify-content: center">
                            <li class="user-menu">
                                <a href="javascript:void(0)" class="dropdown-toggle" data-hover="dropdown">
                                    <img th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}"
                                         th:onerror="this.src='img/profile.jpg'" class="user-image"
                                         style="width: 46px;height: 46px;border-radius: 50%">
                                    <span class="hidden-xs"
                                          style="color: black;font-size: 20px !important; color: #465683;">[[${#strings.defaultString(user.userName, '-')}]]</span>
                                </a>
                            </li>
                            <li>
                                <a onclick="resetPwd()" class="tuichu" style="padding:8px 0">【修改密码】</a>
                            </li>
                            <li>
                                <a th:href="@{logout}" class="tuichu" style="padding:8px 0">【退出】</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
        <a id="ax_close_max" class="ax_close_max" href="javascript:;" title="关闭全屏"> <i
                class="fa fa-times-circle-o"></i> </a>
        <!-- main内容 -->
        <div class="row mainContent" id="content-main" th:classappend="${mainClass}">
            <iframe class="RuoYi_iframe" name="iframe0" width="100%" height="100%" th:data-id="@{/system/main}"
                    th:src="@{/system/main}" frameborder="0" seamless></iframe>
        </div>
        <div th:if="${footer}" class="footer" id="footer">
            <div class="pull-right">© [[${copyrightYear}]] 小门官 Copyright</div>
        </div>
    </div>
    <!--右侧部分结束-->
</div>
<!-- 全局js -->
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
<script th:src="@{/js/jquery.contextMenu.min.js}"></script>
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js?v=4.7.8}"></script>
<script th:src="@{/ruoyi/js/common.js?v=4.7.8}"></script>
<script th:src="@{/ruoyi/index.js?v=20201208}"></script>
<script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
<script th:inline="javascript">
    window.history.forward(1);
    var ctx = [[@{/}]];
    var lockscreen = [[${session.lockscreen}]];
    if (lockscreen) {
        window.top.location = ctx + "lockscreen";
    }
    // 皮肤缓存
    var skin = storage.get("skin");
    // history（表示去掉地址的#）否则地址以"#"形式展示
    var mode = "history";
    // 历史访问路径缓存
    var historyPath = storage.get("historyPath");
    console.log('historyPath', historyPath)
    // 是否页签与菜单联动
    var isLinkage = true;
    // 是否页签切换滚动到顶部
    var isScrollToTop = true;
    $('#nav1').hide()
    $('#nav2').show()

    let isClicked = false; // 标志变量
    $('#systemMain').on('click', function () {
        isClicked = true; // 点击后更新状态
        $('#nav1').hide()
        $('#nav2').show()
        console.log('按钮被点击了！', isClicked);
        var ele = document.getElementById('footer')
        ele.style.background = 'transparent'
        var ele = document.getElementById('footer')
        ele.style.background = '#BBDBF3'
        var collapse = document.getElementById('sidebar-collapse')
        collapse.style.background = '#BBDBF3'
        var logo = document.getElementById('logo')
        logo.style.background = '#BBDBF3'
        // var selectChild = document.getElementById('selectChild')
        // selectChild.style.background = '#BBDBF3'
        // var activeChild = document.querySelector('#selectChild.active');
        // activeChild.style.background = '#BBDBF3'

    });

    $('#secodeChild').on('click', function () {
        isClicked = false; // 点击后更新状态
        console.log('按钮被点击了！', isClicked);
        //
        var elements = document.getElementById('nav1');
        elements.style.background = '#fff'
        var ele = document.getElementById('footer')
        ele.style.background = '#fff'
        var collapse = document.getElementById('sidebar-collapse')
        collapse.style.background = '#fff'
        var logo = document.getElementById('logo')
        logo.style.background = '#fff'
        var selectGk = document.getElementById('selectGk')
        selectGk.style.background = '#fff'
        var selectChild = document.getElementById('selectChild')
        selectChild.style.background = '#fff'
        // var activeChild = document.querySelector('#selectChild.active');
        // activeChild.style.background = '#fff'
        // var activeChild1 = document.querySelector('#systemMain');
        // if (activeChild1) {
        //     console.log('找到的元素:', activeChild);
        // } else {
        //     console.log('未找到符合条件的元素。');
        // }
        $('#nav2').hide()
        $('#nav1').show()
    });

    $('li').on('click', function () {
        console.log('按钮被点击了！1111111111');
    })

    // 左侧年月日时分秒时间显示
    function getCurrentDateTime() {
        const now = new Date(); // 获取当前时间
        const year = now.getFullYear(); // 年
        const month = String(now.getMonth() + 1).padStart(2, '0'); // 月（补零）
        const day = String(now.getDate()).padStart(2, '0'); // 日（补零）
        const hours = String(now.getHours()).padStart(2, '0'); // 时（补零）
        const minutes = String(now.getMinutes()).padStart(2, '0'); // 分（补零）
        const seconds = String(now.getSeconds()).padStart(2, '0'); // 秒（补零）

        // 拼接成完整的时间字符串
        return `${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
    }

    // 获取当前时间
    var element = document.getElementById('date')
    // 每秒更新一次时间
    setInterval(() => {
        element.textContent = getCurrentDateTime();
    }, 1000);

    // 本地主题优先，未设置取系统配置
    if ($.common.isNotEmpty(skin)) {
        $("body").addClass(skin.split('|')[0]);
        $("body").addClass(skin.split('|')[1]);
    } else {
        $("body").addClass([[${sideTheme}]]);
        $("body").addClass([[${skinName}]]);
    }

    /* 用户管理-重置密码 */
    function resetPwd() {
        var url = ctx + 'system/user/profile/resetPwd';
        $.modal.open("重置密码", url, '770', '380');
    }

    /* 切换主题 */
    function switchSkin() {
        layer.open({
            type: 2,
            shadeClose: true,
            title: "切换主题",
            area: ["530px", "386px"],
            content: [ctx + "system/switchSkin", 'no']
        })
    }

    /* 切换菜单 */
    function toggleMenu() {
        $.modal.confirm("确认要切换成横向菜单吗？", function () {
            $.get(ctx + 'system/menuStyle/topnav', function (result) {
                window.location.reload();
            });
        })
    }

    /** 刷新时访问路径页签 */
    function applyPath(url) {
        $('a[href$="' + decodeURI(url) + '"]').click();
        if (!$('a[href$="' + url + '"]').hasClass("noactive")) {
            $('a[href$="' + url + '"]').parent("li").addClass("selected").parents("li").addClass("active").end().parents("ul").addClass("in");
        }
    }

    $(function () {
        var lockPath = storage.get('lockPath');
        if ($.common.equals("history", mode) && window.performance.navigation.type == 1) {
            var url = storage.get('publicPath');
            if ($.common.isNotEmpty(url)) {
                applyPath(url);
            }
        } else if ($.common.isNotEmpty(lockPath)) {
            applyPath(lockPath);
            storage.remove('lockPath');
        } else {
            var hash = location.hash;
            if ($.common.isNotEmpty(hash)) {
                var url = hash.substring(1, hash.length);
                applyPath(url);
            } else {
                if ($.common.equals("history", mode)) {
                    storage.set('publicPath', "");
                }
            }
        }

        /* 初始密码提示 */
        if ([[${isDefaultModifyPwd}]]) {
            layer.confirm("您的密码还是初始密码，请修改密码！", {
                icon: 0,
                title: "安全提示",
                btn: ['确认', '取消'],
                offset: ['30%']
            }, function (index) {
                resetPwd();
                layer.close(index);
            });
        }

        /* 过期密码提示 */
        if ([[${isPasswordExpired}]]) {
            layer.confirm("您的密码已过期，请尽快修改密码！", {
                icon: 0,
                title: "安全提示",
                btn: ['确认', '取消'],
                offset: ['30%']
            }, function (index) {
                resetPwd();
                layer.close(index);
            });
        }
        $("[data-toggle='tooltip']").tooltip();
    });
</script>
</body>
</html>
